/**
 * 
 */
package com.fly.sms.adapter;

import java.util.List;
import java.util.Map;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.fly.sms.BaseActivity;
import com.fly.sms.R;

public class NotifyListAdapter extends IAdapter {
	private List<Map<String, Object>> notifyList=null;

	public NotifyListAdapter(BaseActivity context,List<Map<String, Object>> notifyList) {
		super(context);
		this.notifyList=notifyList;
	}

	public int getCount() {
		return  notifyList.size();
	}

	public Object getItem(int position) {
		return position;
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView==null){
			convertView=context.getView(R.layout.notifyitem);
		}
		Map<String, Object> notify=notifyList.get(position);
		TextView notifyName=(TextView)convertView.findViewById(R.id.notifyName);
		TextView notifyTime=(TextView)convertView.findViewById(R.id.notifyTime);
		notifyName.setText(notify.get("Message").toString());
		notifyTime.setText(notify.get("CreateTime").toString());
		return convertView;
	}
}
